Method A:
ServletActionContext.getRequest() (works internally using a ThreadLocal)
Method B:
Have the action implements ServletRequestAware and the servlet request will be set through setServletRequest(HttpServletRequest) method. This requires the action to have a 'servlet-config' interceptor added.
@see webwork-default.xml
@see com.opensymphony.webwork.interceptor.ServletRequestAware
@see com.opensymphony.webwork.interceptor.ServletConfigInterceptor
|